{% macro render(field, bodyMacro) %}
  {# WARNING: if you remove apos-field as a class you will have problems with nested schemas reusing #}
  {# field names. We use this class with our $.findSafe plugin. #}
  {% set options = { 'id': apos.utils.generateId(), fieldClasses: field.fieldClasses, fieldAttributes: field.fieldAttributes } %}
  <fieldset class="apos-field apos-field-{{ field.type | css }} apos-field-{{ field.name | css }} {{ field.classes }}" data-name="{{ field.name }}" {{ field.attributes }}>
    <label for="{{ options.id }}" class="apos-field-label">{{ __ns('apostrophe', field.label | d('')) }}</label>
    {%- if field.help -%}
      <div class="apos-field-help">{{ __ns('apostrophe', field.help) }}</div>
    {%- elif field.htmlHelp -%}
      <div class="apos-field-help">{{ __ns('apostrophe', field.htmlHelp) | safe }}</div>
    {%- endif -%}
    {{ bodyMacro(field, options) }}
  </fieldset>
{% endmacro %}
